package org.logic.fuzzysets.summarizers.salary;

import org.dataSource.DataBaseInfo;
import org.logic.fuzzysets.AFuzzySet;
import org.logic.membershipFunctions.TriangularFunction;

public class PoorFuzzySet extends AFuzzySet{

	public PoorFuzzySet(DataBaseInfo db) {

		double middleFactor = 0.0;
		setMembershipFunction(new TriangularFunction(db.getMinCapitalGain(),db.getMaxCapitalGain(),middleFactor));
		setUniverse(db.getAllCapitalGains());
	}

	public PoorFuzzySet(DataBaseInfo db,String subject) {

		db.setOnlyRecords(subject);
		setSubject(subject);
		double middleFactor = 0.0;
		setMembershipFunction(new TriangularFunction(db.getMinCapitalGain(),db.getMaxCapitalGain(),middleFactor));
		setUniverse(db.getAllCapitalGains());
	}
	
	@Override
	public String getLabel() {
		AFuzzySet qualifier = getQualifier();
		if(qualifier != null && getSubject()==null)
		return " who "+qualifier.getLabel()+" are poor";
		else
		return "are poor";
	}

}
